import fetch from '@/utils/fetch'

// 1人脸识别设备管理start
export function getFaceList( params) {
	return fetch({
		url: "/accessctrl/v1/mgt/face_access_device",
	    method: 'get',	  
	    params
	})
}
export function getFaceDetail(id) {
	return fetch({
	    url:  `/accessctrl/v1/mgt/face_access_device/${id}`,
	    method: 'get',
	    
  	})
}
// 人脸识别设备管理end


// 2访客管理start
export function getGuestList( params) {
	return fetch({
		url: '/accessctrl/v1/mgt/visitor',
	    method: 'get',	  
	    params
	})
}
export function getGuestDetail(id) {
	return fetch({
	    url:  `/accessctrl/v1/mgt/visitor/${id}`,
	    method: 'get',
	    
  	})
}
// 访客管理end


// 3访客通行记录start
export function getThroughList( params) {
	return fetch({
		url: '/accessctrl/v1/mgt/visitor_access_record',
	    method: 'get',	  
	    params
	})
}
export function getThroughDetail(id) {
	return fetch({
	    url:  `/accessctrl/v1/mgt/visitor_access_record/${id}`,
	    method: 'get',
	    
  	})
}
// 访客通行记录end


//4人员通行记录start
export function getManThroughList( params) {
	return fetch({
		url: '/accessctrl/v1/mgt/person_access_record',
	    method: 'get',	  
	    params
	})
}

export function getManThroughDetail(id) {
	return fetch({
	    url:  `/accessctrl/v1/mgt/person_access_record/${id}`,
	    method: 'get',
	    
  	})
}
// 人员通行记录end


// 5区域管理start
export function getAreaList( params) {
	return fetch({
		url: '/accessctrl/v1/mgt/access_area',
	    method: 'get',	  
	    params
	})
}
export function getAreaDetail(id) {
	return fetch({
	    url:  `/accessctrl/v1/mgt/access_area/${id}`,
	    method: 'get',
	    
  	})
}
// 区域管理end


// 6门禁用户管理start
export function getUserList( params) {
	return fetch({
		url: 'accessctrl/v1/mgt/person',
	    method: 'get',	  
	    params
	})
}
export function getUserDetail(id) {
	return fetch({
	    url:  `/accessctrl/v1/mgt/person/${id}`,
	    method: 'get',
	    
  	})
}
// 门禁用户管理end

// 7门禁卡管理start
export function getCardList( params) {
	return fetch({
		url: '/accessctrl/v1/mgt/card',
	    method: 'get',	  
	    params
	})
}
export function getCardDetail(id) {
	return fetch({
	    url:  `/accessctrl/v1/mgt/card/${id}`,
	    method: 'get',
	    
  	})
}
export function editCard(id, data) {
	return fetch({
	    url: `/accessctrl/v1/mgt/card/${id}`,
	    method: 'patch',
	    data
	})
}

export function addCard(data) {
	return fetch({
	    url:  '/accessctrl/v1/mgt/card',
	    method: 'post',
		data	    
  	})
}
export function lssuedCard(id) {
	return fetch({
	    url:  `accessctrl/v1/mgt/card/${id}/dev_download`,
	    method: 'post',
			    
  	})
}
// 门禁卡管理end 

//拉取总人流量数据列表
export function getChartList(params){
	return fetch({
		url: "/accessctrl/v1/stat/access_day",
		method: "get",
		params
	})
}

//拉取分时人流量列表
export function getAccessTimeShare(params){
	return fetch({
		url:'/accessctrl/v1/stat/access_time_share',
		method:'get',
		params
	})
}

//拉取对应小区区域列表
export function getAccessArea(params){
	return fetch({
		url:'/accessctrl/v1/mgt/access_area',
		method:"get",
		params
	})
}

//-------------400 相关

//工单用户管理
export function getWorkorderUserList( params) {
	return fetch({
		url: 'customer/v1/mgt/affair_user',
	    method: 'get',	  
	    params
	})
}

export function getWorkorderUserDetail(id) {
	return fetch({
	    url:  `/customer/v1/mgt/affair_user/${id}`,
	    method: 'get',
	    
  	})
}

//坐席管理
export function getSeatsMangesList( params) {
	return fetch({
		url: 'customer/v1/mgt/affair_seat',
	    method: 'get',	  
	    params
	})
}
export function getSeatsMangesDetail(id) {
	return fetch({
	    url:  `/customer/v1/mgt/affair_seat/${id}`,
	    method: 'get',
	    
  	})
}

export function SeatsMangesAd(data) {
	return fetch({
	    url:  '/customer/v1/mgt/affair_seat',
	    method: 'post',
		data	    
  	})
}
//坐席排班
export function getSchedulingList( params) {
	return fetch({
		url: 'customer/v1/mgt/affair_scheduling',
	    method: 'get',	  
	    params
	})
}
export function getSchedulingDetail(id) {
	return fetch({
	    url:  `/customer/v1/mgt/affair_scheduling/${id}`,
	    method: 'get',
	    
  	})
}
export function SchedulingAd(data) {
	return fetch({
	    url:  '/customer/v1/mgt/affair_scheduling',
	    method: 'post',
		data	    
  	})
}
//工单管理
export function getWorkorderList(params) {
	return fetch({
		url: '/customer/v2/mgt/affair',
	    method: 'get',	  
	    params
	})
}

export function getRepairDetail(id) {
	return fetch({
		url: `customer/v2/mgt/affair/${id}`,
	    method: 'get',	  
	    
	})
}
//工单来源
export const sourceOfEvents={
	2:"呼叫中心",
	1:"业主APP",
	4:"员工APP",
	3:"管理端"
}
//上报人类型
export const popType={
	2:"业主",
	1:"业主",
	4:"员工",
	3:"业主"
}
//获取方式
export const dispatchType={
	1:"抢单",
	2:"自动派单",
	3:"人工分配"
}